#include "Vector.h"
#include <math.h>
#include <iostream>

float nearestPow2(float x) 
{
	return pow((float)2.0, (float)ceil((float)log10(x)/log10(2.0)));
}

void crossProduct(double y[3], double z[3], double x[3])
{
	x[0] =  y[1]*z[2] - y[2]*z[1];
	x[1] = -y[0]*z[2] + y[2]*z[0];
	x[2] =  y[0]*z[1] - y[1]*z[0];
}

double dotProduct(double x[3], double y[3])
{
	return (x[0]*y[0] + x[1]*y[1] + x[2]*y[2] );
}


double magnitude(double A[3])
{
	return ( sqrt( A[0]*A[0] + A[1]*A[1] + A[2]*A[2] ) );
}

float magnitude(float A[3])
{
	return ( sqrt( A[0]*A[0] + A[1]*A[1] + A[2]*A[2] ) );
}

